package com.bw.controller;


import com.bw.entity.Area;
import com.bw.service.IAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 飓风微尘
 * @since 2022-05-02
 */
@RestController
@RequestMapping("/area")
@CrossOrigin
public class AreaController {
    @Autowired
    IAreaService areaService;
    @RequestMapping("tree")
    public ResponseEntity listtree(){
       List<Area> list= areaService.listtree();

       return new ResponseEntity(list, HttpStatus.OK);
    }

}
